function toCenter(x){
    let W = document.body.clientWidth / 2
    let w = x.width() / 2
    x.css('left', W - w + 'px')
}
function open_toast(type, info) {
    if(type === 'success'){
        $('#toast-success-text').text(info)
        toCenter($('#toast-success'))
        $('#toast-success').toast('show')
    } else if (type === 'fail'){
        $('#toast-fail-text').text(info)
        toCenter($('#toast-fail'))
        $('#toast-fail').toast('show')
    } else if (type == 'warning'){
        $('#toast-warning-text').text(info)
        toCenter($('#toast-warning'))
        $('#toast-warning').toast('show')
    }
}